-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[RyuJit Wasm] fix off by one error for br_table #123565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The count of switch targets does not include the default.
|
@dotnet/jit PTAL We can now run examples with switches, like so: static int sw(int n)
{
switch (n)
{
case 1: case 3: return 10;
case 2: case 4: return 20;
case 5: case 7: return 30;
case 6: case 8: return 40;
default: return 0;
}
}via @kg's harness |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an off-by-one error in the RyuJIT WASM code generation for switch statements using the br_table instruction.
Changes:
- Fixed the count parameter passed to
emitIns_IforINS_br_tableto correctly exclude the default case from the count
adamperlin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
|
/ba-g infrastructure timeout |
The count of switch targets does not include the default.